<?php

namespace IDock\Insurance\TAIC\Response;

use IDock\Http\Response;
use IDock\Printer\PolicyPaymentPrinter;

class PolicyPaymentResponse extends AllTAICResponse
{
    /**
     * @var PolicyPaymentPrinter $printer
     */
    public $printer = PolicyPaymentPrinter::class;

    public function printerInit(): Response
    {
        return $this;
    }

    public function setUrl(string $url)
    {
        if (is_string($this->printer)) {
            $this->printer = new $this->printer;
        }
        $this->printer->payUrl = $url;
    }
}